package com.techysky.util;

import java.net.*;
import java.util.*;

public class MyNetworkInterface3
{
	 public static void main(String[] args) throws Exception
	    {
	   
	        NetworkInterface ni = NetworkInterface.getByName("eth0");
	        System.out.println("Name: " + ni.getName());
	        System.out.println("DisplayName: " + ni.getDisplayName());
	        Enumeration<InetAddress> addresses = ni.getInetAddresses();
	        while (addresses.hasMoreElements())
	            System.out.println(addresses.nextElement().getHostAddress());
	    }
}